package cn.com.headfree.userinfo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.headfree.userinfo.dao.IPrizeDao;
import cn.com.headfree.userinfo.service.IPrizeService;
import cn.com.headfree.vo.PrizeVo;

@Service("prizeService")
public class PrizeServiceImpl implements IPrizeService {
	@Autowired
	private IPrizeDao prizeDao;
	
	@Override
	public List<PrizeVo> getContestPrizes(String beginTimeStr, String endTimeStr, String erpNo) {
		List<PrizeVo> list= prizeDao.getContestPrizes(beginTimeStr,endTimeStr,erpNo);
		for(PrizeVo p:list) {
			p.setItemType(6);
			p.setAward("【竞赛考试】"+p.getAward());
		}
		return list;
	}

	@Override
	public List<PrizeVo> getHonorPrizes(String beginTimeStr, String endTimeStr, String erpNo) {
		List<PrizeVo> list= prizeDao.getHonorPrizes(beginTimeStr,endTimeStr,erpNo);
		for(PrizeVo p:list) {
			p.setItemType(5);
			p.setAward("【个人荣誉】"+p.getAward());
		}
		return list;
	}

	@Override
	public List<PrizeVo> getTecManInnovPrizes(String beginTimeStr, String endTimeStr, String erpNo) {
		List<PrizeVo> list= prizeDao.getTecManInnovPrizes(beginTimeStr,endTimeStr,erpNo);
		for(PrizeVo p:list) {
			p.setItemType(16);
			p.setAward("【科技奖励】"+p.getAward());
		}
		return list;
	}

}
